
import { IsEnabledMapping, ANTD_BUTTON, RequestTypeMapping } from './config'


const {
    ANTD_BUTTON_ICONPOSITION,
    ANTD_BUTTON_SHAPE,
    ANTD_BUTTON_TYPE
} = ANTD_BUTTON

export const modifyTableLadorStyle = [
    { title: '按钮名称', dataIndex: 'title', valueType: 'Input' },
    { title: '图标位置', dataIndex: 'iconPosition', valueType: 'Radio', valueEnum: ANTD_BUTTON_ICONPOSITION },
    { title: '显示名称', dataIndex: 'isTitle', valueType: 'Radio', valueEnum: IsEnabledMapping },
    { title: '显示图标', dataIndex: 'isIcon', valueType: 'Radio', valueEnum: IsEnabledMapping },
    { title: '按钮类型', dataIndex: 'type', valueType: 'Select', valueEnum: ANTD_BUTTON_TYPE },
    { title: '按钮形状', dataIndex: 'shape', valueType: 'Select', valueEnum: ANTD_BUTTON_SHAPE },
    { title: '是否危险', dataIndex: 'danger', valueType: 'Radio', valueEnum: IsEnabledMapping },
    { title: '是否禁用', dataIndex: 'disabled', valueType: 'Radio', valueEnum: IsEnabledMapping },
    { title: '是否幽灵', dataIndex: 'ghost', valueType: 'Radio', valueEnum: IsEnabledMapping },
    { title: '是否间距', dataIndex: 'autoInsertSpace', valueType: 'Radio', valueEnum: IsEnabledMapping },
    { title: '按钮图标', dataIndex: 'icon', valueType: 'Icon' },
]

export const TableLadorTypeMapping = [
    { label: '接口请求', value: 'request' },
    { label: '执行函数', value: 'function' },
    { label: '内置弹窗', value: 'modelBox' },
    { label: '批量操作', value: 'batchBox' },
]

export const modifyTableLadorRequest = [
    { title: '请求方式', dataIndex: 'request_type', valueType: 'Select', valueEnum: RequestTypeMapping },
    { title: '接口地址', dataIndex: 'request_api', valueType: 'Input' },
    { title: '使用主表', dataIndex: 'request_main', valueType: 'Radio', valueEnum: IsEnabledMapping },
    { title: '额外参数', dataIndex: 'request_params', valueType: 'Input' },
    { title: '成功回调', dataIndex: 'successBack', valueType: 'Input' },
    { title: '失败回调', dataIndex: 'errorBack', valueType: 'Input' },
    // { title: '映射参数', dataIndex: 'request_mapping', valueType: 'Input' },
    {
        title: '映射关系',
        dataIndex: 'request_additional',
        valueType: 'Fields',
        min: 0,
        max: 99,
        children: [
            { title: '参数字段', dataIndex: 'request_add_field', valueType: 'Input', },
            { title: '字段类型', dataIndex: 'request_add_type', valueType: 'Input' },
        ]
    },
]

export const modifyTableLadorFunction = []

export const modifyTableLadorModelBox = []

export const modifyTableLadorBatchBox = []